package com.modbus.tcp.service;

import com.modbus.tcp.domain.Ballvalveaddr;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 球阀modbus地址 服务层
 *
 * @author d
 * @date 2024-01-11
 */
public interface IBallvalveaddrService {

    /**
     * 查询球阀modbus地址信息
     *
     * @param ballvalueid 球阀modbus地址ID
     * @return 球阀modbus地址信息
     */

    public Ballvalveaddr selectBallvalveaddrById(@RequestParam("ballvalueid") Integer ballvalueid);

    public  Ballvalveaddr selectBallvalveByPartcode(long id,long partcode);


    /**
     * 查询球阀modbus地址列表
     *
     * @param ballvalveaddr 球阀modbus地址信息
     * @return 球阀modbus地址集合
     */
    public List<Ballvalveaddr> selectBallvalveaddrList(@RequestBody Ballvalveaddr ballvalveaddr);


    public  List<Ballvalveaddr> selectSensorData( Integer id);


    public List<Ballvalveaddr> allBallvalveaddr();

    public List<Ballvalveaddr> selectShengGuangOpen();

    public List<Ballvalveaddr> selectShengGuangClose();
    /**
     * 新增球阀modbus地址
     *
     * @param ballvalveaddr 球阀modbus地址信息
     * @return 结果
     */
    @PostMapping("insertBallvalveaddr")
    public int insertBallvalveaddr(@RequestBody Ballvalveaddr ballvalveaddr);

    /**
     * 修改球阀modbus地址
     *
     * @param ballvalveaddr 球阀modbus地址信息
     * @return 结果
     */
    @PostMapping("updateBallvalveaddr")
    public int updateBallvalveaddr(@RequestBody Ballvalveaddr ballvalveaddr);

    /**
     * 删除球阀modbus地址信息
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @GetMapping("deleteBallvalveaddrByIds")
    public int deleteBallvalveaddrByIds(@RequestParam("ids") String ids);
}